#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#define N 20
int func(char a[])
{
	int n = 0;
	char* p ;
	p = a;
	while (*p != '\0')
	{
		if ((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z'))
		{
			if((*(p+1)< 'a' || *(p + 1) >'z') && (*(p + 1) < 'A' || *(p + 1) > 'Z'))
				n++;
		}
		
		p++;
	}
	return n;
}
int main()
{
	char a[N];
	gets(a);
	int b = func(a);
	printf("%d", b);
	return 0;
}
